﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Runtime.Serialization;

namespace BrainTechLLC
{
    [DataContract]
    public class SerializedAttribute : Attribute
    {

    }

    public static class SLExtensions
    {
        public static void SetVisible(this UIElement elem, bool vis)
        {
            if (vis)
                elem.Visibility = Visibility.Visible;
            else
                elem.Visibility = Visibility.Collapsed;
        }

        public static bool Toggle(this UIElement elem)
        {
            bool open = false;

            if (elem.Visibility == Visibility.Collapsed)
                open = true;

            elem.Visibility = (elem.Visibility == Visibility.Collapsed) ?
                Visibility.Visible : Visibility.Collapsed;

            return open;
        }
    }

    //[DataContract]
    //public class BrowsableAttribute : Attribute
    //{
    //    public bool Browsable { get; set; }
    //    public BrowsableAttribute() { }
    //    public BrowsableAttribute(bool browsable) { Browsable = browsable; }
    //}

    //[DataContract]
    //public class TypeConverterAttribute : Attribute
    //{
    //    public Type Type { get; set; }
    //    public TypeConverterAttribute() { }
    //    public TypeConverterAttribute(Type t) { Type = t; }
    //}

    [DataContract]
    public class ExpandableObjectConverter
    {
    }

    //[DataContract]
    //public enum EditorBrowsableState
    //{
    //    [EnumMember]
    //    Never = 0,
    //    [EnumMember]
    //    Always = 1,
    //    [EnumMember]
    //    Advanced = 2
    //}

    public interface INotifyCollectionChanged
    {
    }

    public interface INotifyPropertyChanging
    {
    }

    //public class TypeDescriptionProviderAttribute : Attribute
    //{
    //    public Type Type { get; set; }
    //    public TypeDescriptionProviderAttribute() { }
    //    public TypeDescriptionProviderAttribute(Type t) { Type = t; }
    //}

    //public class EditorBrowsableAttribute : Attribute
    //{
    //    public EditorBrowsableState State { get; set; }
    //    public EditorBrowsableAttribute() { }
    //    public EditorBrowsableAttribute(EditorBrowsableState state) { State = state; }
    //}

    public class OnDeserializedAttribute : Attribute
    {
    }

    public class SerializableAttribute : Attribute
    {
    }

    public class DisplayNameAttribute : Attribute
    {
        public string DisplayName { get; set; }
        public DisplayNameAttribute() { }
        public DisplayNameAttribute(string s) { DisplayName = s; }
    }

    public class NonSerializedAttribute : Attribute
    {
    }

    public class PropertyChangingEventArgs : EventArgs
    {
        public string Property { get; set; }
        public PropertyChangingEventArgs() { }
        public PropertyChangingEventArgs(string prop) { Property = prop; }
    }
}
